package com.lr.util;

public class Result <T>{
    private Integer code;
    private T data;
    public Result(Integer code, T data) {
        this.code = code;
        this.data = data;
    }
    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
    public static <T> Result<T> success(T data){
        return new Result<T>(200,data);
    }
    public static <T> Result<T> error(T data){
        return new Result<T>(500,data);
    }
    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
